home *** CD-ROM | disk | FTP | other *** search
/ Sky at Night 2007 August / SAN CD 8-2007 CD-ROM 27.iso / pc / Software / PlanetEngine / install.exe / install.dxr / 00001_Installer.ls next >
Encoding:
Text File  |  2007-06-15  |  1.2 KB  |  56 lines

  1. property srcPath, defName, destPath, pathSep
  2.  
  3. on new me, aSrcPath, aDefName
  4.   if not stringp(aSrcPath) then
  5.     return VOID
  6.   end if
  7.   if not baFolderExists(aSrcPath) then
  8.     return VOID
  9.   end if
  10.   if not stringp(aDefName) then
  11.     return VOID
  12.   end if
  13.   if aDefName = EMPTY then
  14.     return VOID
  15.   end if
  16.   if the platform contains "mac" then
  17.     pathSep = ":"
  18.   else
  19.     pathSep = "\"
  20.   end if
  21.   me.srcPath = aSrcPath
  22.   me.defName = aDefName
  23.   me.destPath = EMPTY
  24.   return me
  25. end
  26.  
  27. on chooseDest me
  28.   thePath = baGetFolder(the moviePath & defName, "Select a folder to install the program into...", 1 + 2, "Select folder", -2, -2)
  29.   if thePath = EMPTY then
  30.     theResult = 0
  31.   else
  32.     me.destPath = thePath & me.defName & me.pathSep
  33.     theResult = 1
  34.   end if
  35.   return theResult
  36. end
  37.  
  38. on confirmInstall me
  39.   if baMsgBox("Are you sure you want to copy the program files into the folder" & RETURN & me.destPath, "Confirm Installation", "OKCancel", "question", 1) = "OK" then
  40.     theResult = 1
  41.   else
  42.     theResult = 0
  43.   end if
  44.   return theResult
  45. end
  46.  
  47. on copyFiles me
  48.   copyResult = baXCopy(me.srcPath, me.destPath, "*.*", "Always", 1)
  49.   if copyResult > 0 then
  50.     theResult = 0
  51.   else
  52.     theResult = 1
  53.   end if
  54.   return theResult
  55. end
  56.